Skip to main content

Console Application Lab

Objective

Develop a console application that retrieves and displays the friendly name associated with a given Account ID and Person ID. The lab will guide users through the necessary steps to implement this functionality.

Credentials

  • User ID: Test
  • Password: P@$$w0rd

Steps

  1. Start the 20331B-NYC-DC-05 virtual machine. Wait for the virtual machine to display the Desktop.

  2. On your Desktop, Right-click Workflow Studio (WFS), and then click Run as administrator. Workflow Page

  3. Wait for WFS to start and enter your credentials.

    Workflow Page
    Workflow Page
  4. In Solution Explorer, right-click on the Developer Packages folder, create a new folder called DemoLabs, and click the Ok button.

  5. Add New Folder dialog box will appear from it; select the following options:

    • Console Applications
    • And click the Ok button.
    Workflow Page
    Workflow Page
  6. Expand the Developer Packages folder, find the DemoLabs folder, expand it under the DemoLabs folder, right-click on the Console Applications folder. Workflow Page

  7. Wait for Console Application to be loaded.

  8. Click on the Save icon to save your Console Application and give it a name CAGetPersonByID. Workflow Page

  9. Click on the Save button.

  10. Once you are back to console application designer code. Close the tab. Workflow Page

  11. In the left navigation pane, open the to Demo Labs folder and double- click on the console application and it will then open in the Visual Studio. Workflow Page

note

In the Solution Explorer (typically on the right side of Visual Studio), you will notice that the project includes references to various EmpowerID assemblies. These assemblies contain the necessary code for interacting with the EmpowerID platform, including the components.

  1. In the Solution Explorer, double-click the Program.cs file. This will open the class that contains the Main method. Workflow Page
note

Observe the default namespace using directives at the top of the file. You will likely see namespaces related to EmpowerID, including components Workflow Page

  1. Write below code in the main method.
//TODO: Implementation code goes here
int personID = 0545654;
int accountID = 0987;

C.Person person = C.Person.GetByPersonID(personID);
Console.WriteLine("Friendly Name: " + person.FriendlyName);

var acc = C.Account.GetByAccountID(accountID);
Console.WriteLine("Friendly Name: " + acc.FriendlyName);

Console.ReadLine();

Workflow Page

info

Ensure that you pass the correct person IDs to the methods listed above to obtain the expected results.

  1. Run the Console Application and you will see the results in the window. Workflow Page